07. Nesting Grids in Practice

Building Responsive Layouts with Flexbox & Grid Example Prep

Nesting Grids in Practice

In the screencast below you’ll see how nesting grids works in practice, and how a nested grid can be used to make a simple image gallery.

ND001 C01 L05 07 Building Responsive Layouts With Flexbox Grid Example

Building Responsive Layouts with Flexbox & Grid Example Summary

Nesting CSS grids is simple and can be done simply by using the display:grid rule for both a parent and child element.

Here is how that could look with real code:

.container {
  display:grid;
  // ...
}

#one {
  display:grid
}

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: html-live
  • Opened files (when workspace is loaded): n/a

Building Responsive Layouts with Flexbox & Grid Summary

In this section we covered how to nest grids to make creative layouts for the web, and how CSS grid can be used to create an easy photo gallery for a website or blog.